Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p>Click the button to encode a string in base-64.</p> <button onclick="myFunction()">Try it</button> <p><strong>Note:</strong> The btoa() method is not supported in IE9 and earlier.</p> <p id="demo"></p> <script> function myFunction() { var str = "Hello World!"; var enc = window.btoa(str); var res = "Encoded String: " + enc; document.getElementById("demo").innerHTML = "The original string: " + str + "<br>" + res; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_btoa by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:27:56 GMT --> </html>
Result:
Try it Yourself - © w3schools.com